package com.example.wlf.gamerecorder;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

import com.example.wlf.gamerecorder.gameon.SimpleGameonActivity;

public class MyHandler extends Handler {
    private final static int COUNT = 1;
    @Override
    public void handleMessage(Message msg) {
        int second;
        int minute;
        switch (msg.what) {
            case COUNT:
                SimpleGameonActivity.textViewTime24.setText(String.valueOf(msg.arg1));
                if(msg.arg1 == 0)
                    SimpleGameonActivity.timer24.cancel();//0秒结束
                minute = msg.arg2 / 60;
                second = msg.arg2 % 60;
                SimpleGameonActivity.textViewTimeMinute.setText(String.format("%02d",minute) + ":" + String.format("%02d",second));
                break;
            default:
                break;
        }
    }
}
